package com.unitd.base.module.shoe.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unitd.base.frame.plugin.db.datasource.annotion.DataSource;
import com.unitd.base.module.shoe.mybatis.mapper.CustomerMapper;
import com.unitd.base.module.shoe.pojo.po.CustomerPO;
import com.unitd.base.module.shoe.service.CustomerService;
import org.springframework.stereotype.Service;

/**
 * 客户档案信息表信息业务逻辑处理接口实现类
 *
 * @author Hudan
 * @version 1.0
 * @filename CustomerServiceImpl.java
 * @copyright www.unitd.com
 * @date 2020-08-12
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerPO> implements CustomerService {

    /**
     * 根据手机号码获取该手机号对应的用户信息
     *
     * @param datasource 需要读取的数据名称
     * @param mobile     用户手机号码
     * @return 用户信息
     */
    @Override
    @DataSource(name = "datasource")
    public CustomerPO selectByMobile(String datasource, String mobile) {
        return baseMapper.selectByMobile(mobile);
    }
}